package cn.mrcode.fd.blog.enu;

/**
 * 文章错误枚举类
 * @author : zhuqiang
 * @version : V1.0
 * @date : 2016/6/11 18:41
 */
public enum ArticleError {
    SYSTEM_ERROR(-1,"系统错误");

    private int code;
    private String info;

    ArticleError(int code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getInfo() {
        return info;
    }
    public int getCode() {
        return code;
    }

    public String codeOf(int code){
        for (AccountError err: AccountError.values()) {
            if(err.getCode() == code){
                return err.getInfo();
            }
        }
        return null;
    }
}
